import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:mandoby/core/app_export.dart';
import 'package:mandoby/core/utils/app_colors.dart';
import 'package:mandoby/core/widgets/app_bar/custom_app_bar.dart';
import 'package:mandoby/core/widgets/custom_bottom_bar.dart';
import 'package:mandoby/core/widgets/custom_elevated_button.dart';
import 'package:mandoby/core/widgets/custom_text_form_field.dart';
import 'package:mandoby/features/nationally/presentation/pages/nationally_screen.dart';
import 'package:mandoby/features/university_category/presentation/pages/university_category_screen.dart';
import 'package:nb_utils/nb_utils.dart';

import '../../../../../core/widgets/custom_scaffold_widget.dart';

class HomeScreen extends StatelessWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CustomScaffoldWidget(
      decoration: AppDecoration.gradientWhiteAToBlueGray,
      appBar: CustomAppBar(),
      screenPadding: EdgeInsets.symmetric(horizontal: 20.h),
      body: ListView(
        children: [
          50.hs,
          Row(
            children: [
              RichText(
                  text: TextSpan(children: [
                TextSpan(
                    text: " الجنسية المختارة",
                    style: CustomTextStyles.font24bBlack400),
                TextSpan(
                    text: " (الكويت)  ", style: CustomTextStyles.font24Primary700),

              ])),
              Text("تغير الجنسية",style: CustomTextStyles.font13lightBlue400,).onTap((){
                NationallyScreen().launch(context,isNewTask: true);
              }),
            ],
          ),
          20.hs,
          ListView.separated(
            separatorBuilder: (context, index) => 15.hs
            ,
            shrinkWrap: true,
            physics: NeverScrollableScrollPhysics(),
            itemCount: 5,
            itemBuilder: (context, index) => Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Container(
                  width: 250.w,
                  alignment: Alignment.center,
                  padding:
                      EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h),
                  decoration: BoxDecoration(
                      color: AppColors.whiteA700,
                      borderRadius: BorderRadius.circular(4),
                      border: Border.all(color: AppColors.primary)),
                  child: Column(
                    children: [
                      CustomImageView(
                        imagePath: AppAssets.imgRectangle67,
                        width: 40.w,
                        height: 40.h,
                      ),
                      Text(
                        "تعليم جامعي",
                        style: CustomTextStyles.font28whiteA700w800
                            .copyWith(color: AppColors.black900),
                      ),
                      10.hs,
                      Container(
                        
                        height: 4.h,
                        width: 160.w,
                        decoration: BoxDecoration(
                          color: AppColors.primary.withOpacity(0.8),
                          borderRadius: BorderRadius.circular(10)
                        ),
                      )
                    ],
                  ),
                ),
              ],
            ).onTap((){
              UniversityCategoryScreen().launch(context);
            }).animate().slideX(),
          ),
          50.hs,
        ],
      ),
      navBar: CustomBottomBar(selectedIndex: 0),
    );
  }
}
